home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
rjs.lha
/
RJS
/
String
/
tests
/
top_minus.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-14
|
853b
|
54 lines
#include "test.h"
void Minus()
{
String s1("abcd");
String s2;
s1="abcd";
Assert( (s1-=1)=="abc"); s1.VERIFY();
Assert( (s1-=10)=="abc"); s1.VERIFY();
Assert( (s1-='c')=="ab"); s1.VERIFY();
Assert( (s1-='z')=="ab"); s1.VERIFY();
s1="abcd";
Assert( (s1-="cd")=="ab"); s1.VERIFY();
Assert( (s1-="qz")=="ab"); s1.VERIFY();
s1="abcd"; s2="cd";
Assert( (s1-=s2)=="ab"); s1.VERIFY();
s2="qz";
Assert( (s1-=s2)=="ab"); s1.VERIFY();
s1="abcd1234";
Assert( (s1-=SSint)=="abcd"); s1.VERIFY();
Assert( (s1-=SSint)=="abcd"); s1.VERIFY();
s1="abcd";
Assert( (s1-1)=="abc");
Assert( (s1-10)=="abcd");
Assert( (s1-'d')=="abc");
Assert( (s1-'z')=="abcd");
s1="abcd";
Assert( (s1-"cd")=="ab");
Assert( (s1-"qz")=="abcd");
s1="abcd"; s2="cd";
Assert( (s1-s2)=="ab");
s2="qz";
Assert( (s1-s2)=="abcd");
s1="abcd ";
Assert( (s1-SSwhite)=="abcd");
}